package com.greate.community.service.impl;

import com.greate.community.entity.FraudCase;
import com.greate.community.mapper.FraudCaseMapper;
import com.greate.community.service.FraudCaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 诈骗案例服务实现类
 */
@Service
public class FraudCaseServiceImpl implements FraudCaseService {

    @Autowired
    private FraudCaseMapper fraudCaseMapper;

    @Override
    public List<FraudCase> findAllCases() {
        return fraudCaseMapper.selectAllCases();
    }

    @Override
    public FraudCase findCaseById(int id) {
        return fraudCaseMapper.selectCaseById(id);
    }

    @Override
    public List<FraudCase> findCasesByType(String type) {
        return fraudCaseMapper.selectCasesByType(type);
    }

    @Override
    public int addCase(FraudCase fraudCase) {
        return fraudCaseMapper.insertCase(fraudCase);
    }

    @Override
    public int updateCase(FraudCase fraudCase) {
        return fraudCaseMapper.updateCase(fraudCase);
    }

    @Override
    public int deleteCase(int id) {
        return fraudCaseMapper.deleteCase(id);
    }

    @Override
    public int updateCaseStatus(int id, int status) {
        return fraudCaseMapper.updateCaseStatus(id, status);
    }

    @Override
    public int updateCaseType(int id, String type) {
        return fraudCaseMapper.updateCaseType(id, type);
    }
}